Skip to content

fix(feeds): skip automatic requests while offline - #474

Merged
chhoumann merged 2 commits into
masterfrom
fix/offline-feed-requests
Oct 14, 2026
Merged

chhoumann merged 2 commits into
masterfrom
fix/offline-feed-requests

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Opening PodNotes offline now shows cached episodes without automatic feed requests. Reconnecting refreshes missing or expired feeds once. ensureAll hydrates before applying the online gate, so an automatic offline request cannot absorb the reconnect refresh.

Fixes #460

Verification

  • Passed npm run lint, npm run format:check, npm run typecheck, npm run build, npm run test with 2,558 tests, npm run test:tooling with 13 tests, and npm run docs:build. Commands used Node 22 through fnm exec --using 22 --.
  • Passed npm run test:e2e on a fresh isolated vault in Obsidian 1.14.4 on Linux, then with PODNOTES_OBSIDIAN_APP=/opt/Obsidian/obsidian on 1.13.7, with 188 tests each. With two expired fixture feeds and a stopped server, offline attempts fell from 2 to 0. Holding the baseline requests reproduced 0 fresh reconnect attempts; the fix made exactly 2 and updated both lists. Fixtures use http://podnotes.test:<port>/feed2-alpha/feed.xml and /feed2-beta/feed.xml.
  • npm run count:writes -- start, report, and stop recorded 3 completed writes before and after the fix, with 0 failures. npm run size passed at 99,052 gzip bytes, an increase of 15 bytes. Runtime screenshot.

Verification logs and review reports include the failing baseline, passing runs, and mutation scripts.

Four wrong alternatives each failed a named test:

  • Read navigator.onLine instead of the online store. automatic loading follows the online store and reconnect starts a fresh request failed.
  • Skip offline hydration. offline, an expired cache shows without a request failed.
  • Ignore subscription changes. subscription changes load only when online failed.
  • Force network refreshes for fresh caches. a document is fetched again once it is more than six hours old failed.

Scope

This covers automatic startup, view opening, subscription changes, and reconnect. Refresh and Retry retain their offline behavior. Cancellation of requests started online before a drop, or explicitly through a URI while offline, remains separate work.

Release impact

No settings, storage format, public API, or URI changes. No migration.

Docs at release

Update docs/src/content/docs/podcasts.md, under When a feed cannot be reached, to explain cached lists appearing offline without automatic requests, missing or expired feeds refreshing on reconnect, and Refresh being unavailable offline. Published docs are unchanged.

Note

Skip automatic feed requests while offline in FeedRepository.ensureAll

  • FeedRepository.ensureAll now takes an online option; offline calls hydrate stored feed state and return success without any network requests, while online calls use the existing load path (FeedRepository.ts)
  • PodcastView.svelte replaces the onMount init call with a reactive effect that runs ensureAll with the current online state, so feeds load again on reconnect
  • Extensive new tests cover offline expired caches, empty caches, reconnect behavior, shared URLs, and a parameterized e2e scenario in offline-feed-requests.test.ts; existing tests updated to pass online: true
  • Risk: ensureAll signature changed — all call sites must pass the new online option; offline open shows cached episodes as stale with refresh controls disabled

Macroscope summarized 873e688.

@chhoumann chhoumann linked an issue Oct 14, 2026 that may be closed by this pull request
@chhoumann
chhoumann merged commit b6e9821 into master Oct 14, 2026
18 checks passed
@chhoumann
chhoumann deleted the fix/offline-feed-requests branch October 14, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening the view offline still requests every feed

1 participant